#ifndef MAINWIDGET_H
#define MAINWIDGET_H

#include <phonon>
#include <QList>
#include <QQueue>
#include <QString>
#include <QTime>
#include <QTimerEvent>
#include <QUrl>
#include <QWidget>

namespace Ui { class MainWidget; }

class MainWidget : public QWidget
{
  Q_OBJECT

  struct verb  { QString main, third_singular, past; };

  Ui::MainWidget *ui;
  QList<verb> m_verbs;
  bool m_done;
  int m_pronoun, m_verb, m_time, m_sentence;
  size_t m_task, m_answer;
  Phonon::MediaObject* m_media;
  Phonon::AudioOutput* m_output;
  QQueue<QUrl> m_files;
  QTime m_qtime;

  void scan();
  void step(int time = -1, int sentence = -1);
    
private slots:
  void on_finished();
  void on_matrix_doubleClicked(const QModelIndex &index);
  void on_next_clicked();
  void on_repeat_clicked();

protected:
  virtual void timerEvent(QTimerEvent*);

public:
  explicit MainWidget(QWidget *parent = 0);
  ~MainWidget();
}; // MainWidget

#endif // MAINWIDGET_H
